package zxj.spay.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * 一个用户表
 * @author 朱小杰
 * 日期:2016-05-01
 *
 */
@Table(name="user")
@Entity
public class User implements Serializable{
	private static final long serialVersionUID = -1635371285946158484L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private int id;
	
	/**
	 * 用户名
	 */
	@Column(unique=true,nullable=false)
	private String username;
	
	/**
	 * 用户呢称
	 */
	@Column(nullable=false)
	private String nickName;
	
	/**
	 * 用户密码
	 */
	@Column(nullable=false)
	private String password;
	
	/**
	 * 创建时间
	 */
	@Column(nullable=false)
	private Date createTime;
	
	/**
	 * 最后登陆时间
	 */
	private Date lastLoginTime;
	
	
/*	@OneToMany(cascade={CascadeType.ALL},mappedBy="user")
	private Set<Stream> stream;
	
	@OneToMany(cascade={CascadeType.ALL},mappedBy="user")
	private Set<Type> type;*/

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}
	
/*	public Set<Stream> getStream() {
		return stream;
	}

	public void setStream(Set<Stream> stream) {
		this.stream = stream;
	}

	public Set<Type> getType() {
		return type;
	}

	public void setType(Set<Type> type) {
		this.type = type;
	}*/
	


}
